<template>
	<view id="parent">

		<view id="head">
			<view id="front">
				<img :src="headImg" />
				<view id="text">
					<view>{{createBy}}</view>
					<view>{{createTime}}</view>
				</view>
			</view>
			<view id="text">
				<view>
					{{title}}
				</view>
			</view>
		</view>

		<div class="ql-container ql-snow">
			<div class="ql-editor">
				<div v-if="content" v-html="content"></div>
			</div>
		</div>
	</view>
</template>

<script>
	import {
		consult
	} from '@/api/index'

	export default {
		data() {
			return {
				headImg: '',
				title: '',
				content: '',
				createBy: '',
				createTime: ''
			}
		},
		onLoad(option) {
			consult(option.id).then(res => {
				let data = res.data
				this.headImg = data.headImg
				this.title = data.title
				this.content = data.content
				this.createTime = data.createTime
				this.createBy = data.createBy
			}).catch(e => {
				this.$modal.msgLoading('暂无')
			})
		}
	}
</script>
<style>
	@import '@/static/scss/quill.snow.css';

	page {
		background: linear-gradient(180deg, #c4d6ff, #f7f8fa);
		min-height: 100%;
	}

	#head {
		font-size: 13.5px;
		padding: 4px 6px;
		background-color: aliceblue;
		display: flex;
		justify-content: space-between;

		#front {
			display: flex;
			justify-content: space-between;

			img {
				width: 12vw;
				height: 12vw;
				border-radius: 4px;
			}
		}

		#text {
			display: flex;
			flex-direction: column;
			justify-content: space-around;
		}
	}
</style>